package com.linjiahao.nettyBus.handler;

import com.linjiahao.commonUtil.base.SpringContextUtil;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import org.springframework.stereotype.Component;

/**
 * @ClassName NettyServerInitializer
 * @Description: TODO
 * @Author linjiahao
 * @Date 2022/3/22
 **/
@Component
@ChannelHandler.Sharable
public class NettyServerInitializer extends ChannelInitializer<SocketChannel> {



    @Override
    protected void initChannel(SocketChannel socketChannel){
        socketChannel.pipeline().addLast("socketChoose", SpringContextUtil.getBeanByClass(SocketChooseHandler.class));
    }
}
